﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace TProject
{
    class Employee : Person
    {
        float salary;
        public float Salary 
        {
            get { return salary; }
            set 
            {
                if (salary <= 0)
                    salary = 300f;
                else
                    salary = value;
            }
        }

        public Employee(int _Id, string _Name, int _Age, float _Salary)
            : base(_Id, _Name, _Age)
        {
            this.salary = _Salary;
        }

        public override string ToString()
        {
            return name + " : " + age;
        }
    }
}
